using UnityEngine;
using System.Collections;

public class Player : MonoBehaviour {

	public float playerSpeed;
	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
	
		float amtToMove = Input.GetAxis("Horizontal")*Time.deltaTime*playerSpeed;
		gameObject.transform.Translate(Vector3.right*amtToMove);
		
		if (transform.position.x > 11)
			transform.position = new Vector3(-11f, transform.position.y);
		if (transform.position.x < -11)
			transform.position = new Vector3(11f, transform.position.y);
	}
}
